/****** Object:  Table [dbo].[Manager]    Script Date: 2014/6/4 22:27:52  ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Manager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Manager]
GO

/****** Object:  Table [dbo].[Manager]    Script Date: 2014/6/4 22:27:52   ******/
CREATE TABLE [dbo].[Manager] (
  [Id] [int] IDENTITY (1, 1) NOT NULL,
  [LoginName] [nvarchar] (20) NOT NULL,
  [LoginPass] [nvarchar] (32) NOT NULL,
  [LoginTime] [datetime] NOT NULL,
  [LoginIp] [nvarchar] (30) NOT NULL,
  [LoginCount] [int] NOT NULL,
  [CreateTime] [datetime] NOT NULL,
  [UpdateTime] [datetime] NOT NULL,
  [IsMultiUser] [tinyint] NOT NULL,
  [Branch_Id] [int] NOT NULL,
  [Branch_Code] [nvarchar] (20) NOT NULL,
  [Branch_Name] [nvarchar] (25) NOT NULL,
  [Position_Id] [nvarchar] (100) NOT NULL,
  [Position_Name] [nvarchar] (30) NOT NULL,
  [IsWork] [tinyint] NOT NULL,
  [IsEnable] [tinyint] NOT NULL,
  [CName] [nvarchar] (20) NOT NULL,
  [EName] [nvarchar] (50) NOT NULL,
  [PhotoImg] [nvarchar] (250) NOT NULL,
  [Sex] [nvarchar] (4) NOT NULL,
  [Birthday] [nvarchar] (20) NOT NULL,
  [NativePlace] [nvarchar] (100) NOT NULL,
  [NationalName] [nvarchar] (50) NOT NULL,
  [Record] [nvarchar] (25) NOT NULL,
  [GraduateCollege] [nvarchar] (30) NOT NULL,
  [GraduateSpecialty] [nvarchar] (50) NOT NULL,
  [Tel] [nvarchar] (30) NOT NULL,
  [Mobile] [nvarchar] (30) NOT NULL,
  [Email] [nvarchar] (50) NOT NULL,
  [Qq] [nvarchar] (30) NOT NULL,
  [Msn] [nvarchar] (30) NOT NULL,
  [Address] [nvarchar] (100) NOT NULL,
  [Content] [ntext] NOT NULL,
  [Manager_Id] [int] NOT NULL,
  [Manager_CName] [nvarchar] (20) NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Manager] WITH NOCHECK ADD
  CONSTRAINT [PK_Manager] PRIMARY KEY  CLUSTERED
(
 [Id]
)  ON [PRIMARY]
GO

ALTER TABLE [dbo].[Manager] ADD
  CONSTRAINT [DF_Manager_LoginName] DEFAULT ('') FOR [LoginName],
  CONSTRAINT [DF_Manager_LoginPass] DEFAULT ('') FOR [LoginPass],
  CONSTRAINT [DF_Manager_LoginTime] DEFAULT (getdate()) FOR [LoginTime],
  CONSTRAINT [DF_Manager_LoginIp] DEFAULT ('') FOR [LoginIp],
  CONSTRAINT [DF_Manager_LoginCount] DEFAULT (0) FOR [LoginCount],
  CONSTRAINT [DF_Manager_CreateTime] DEFAULT (getdate()) FOR [CreateTime],
  CONSTRAINT [DF_Manager_UpdateTime] DEFAULT (getdate()) FOR [UpdateTime],
  CONSTRAINT [DF_Manager_IsMultiUser] DEFAULT (0) FOR [IsMultiUser],
  CONSTRAINT [DF_Manager_Branch_Id] DEFAULT (0) FOR [Branch_Id],
  CONSTRAINT [DF_Manager_Branch_Code] DEFAULT ('') FOR [Branch_Code],
  CONSTRAINT [DF_Manager_Branch_Name] DEFAULT ('') FOR [Branch_Name],
  CONSTRAINT [DF_Manager_Position_Id] DEFAULT ('') FOR [Position_Id],
  CONSTRAINT [DF_Manager_Position_Name] DEFAULT ('') FOR [Position_Name],
  CONSTRAINT [DF_Manager_IsWork] DEFAULT (0) FOR [IsWork],
  CONSTRAINT [DF_Manager_IsEnable] DEFAULT (1) FOR [IsEnable],
  CONSTRAINT [DF_Manager_CName] DEFAULT ('') FOR [CName],
  CONSTRAINT [DF_Manager_EName] DEFAULT ('') FOR [EName],
  CONSTRAINT [DF_Manager_PhotoImg] DEFAULT ('') FOR [PhotoImg],
  CONSTRAINT [DF_Manager_Sex] DEFAULT ('') FOR [Sex],
  CONSTRAINT [DF_Manager_Birthday] DEFAULT ('') FOR [Birthday],
  CONSTRAINT [DF_Manager_NativePlace] DEFAULT ('') FOR [NativePlace],
  CONSTRAINT [DF_Manager_NationalName] DEFAULT ('') FOR [NationalName],
  CONSTRAINT [DF_Manager_Record] DEFAULT ('') FOR [Record],
  CONSTRAINT [DF_Manager_GraduateCollege] DEFAULT ('') FOR [GraduateCollege],
  CONSTRAINT [DF_Manager_GraduateSpecialty] DEFAULT ('') FOR [GraduateSpecialty],
  CONSTRAINT [DF_Manager_Tel] DEFAULT ('') FOR [Tel],
  CONSTRAINT [DF_Manager_Mobile] DEFAULT ('') FOR [Mobile],
  CONSTRAINT [DF_Manager_Email] DEFAULT ('') FOR [Email],
  CONSTRAINT [DF_Manager_Qq] DEFAULT ('') FOR [Qq],
  CONSTRAINT [DF_Manager_Msn] DEFAULT ('') FOR [Msn],
  CONSTRAINT [DF_Manager_Address] DEFAULT ('') FOR [Address],
  CONSTRAINT [DF_Manager_Content] DEFAULT ('') FOR [Content],
  CONSTRAINT [DF_Manager_Manager_Id] DEFAULT (0) FOR [Manager_Id],
  CONSTRAINT [DF_Manager_Manager_CName] DEFAULT ('') FOR [Manager_CName]
GO

CREATE  INDEX [IX_Manager__LoginName] ON [dbo].[Manager]([LoginName]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__LoginTime] ON [dbo].[Manager]([LoginTime]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__CreateTime] ON [dbo].[Manager]([CreateTime]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__UpdateTime] ON [dbo].[Manager]([UpdateTime]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__Branch_Id] ON [dbo].[Manager]([Branch_Id]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__Branch_Code] ON [dbo].[Manager]([Branch_Code]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__Position_Id] ON [dbo].[Manager]([Position_Id]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__IsWork] ON [dbo].[Manager]([IsWork]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__IsEnable] ON [dbo].[Manager]([IsEnable]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__CName] ON [dbo].[Manager]([CName]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__EName] ON [dbo].[Manager]([EName]) ON [PRIMARY]
GO

CREATE  INDEX [IX_Manager__Sex] ON [dbo].[Manager]([Sex]) ON [PRIMARY]
GO

exec sp_addextendedproperty N'MS_Description', N'主键Id', N'user', N'dbo', N'table', N'Manager', N'column', N'Id'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆账号', N'user', N'dbo', N'table', N'Manager', N'column', N'LoginName'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆密码', N'user', N'dbo', N'table', N'Manager', N'column', N'LoginPass'
GO

exec sp_addextendedproperty N'MS_Description', N'最后登陆时间', N'user', N'dbo', N'table', N'Manager', N'column', N'LoginTime'
GO

exec sp_addextendedproperty N'MS_Description', N'最后登陆IP', N'user', N'dbo', N'table', N'Manager', N'column', N'LoginIp'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆次数', N'user', N'dbo', N'table', N'Manager', N'column', N'LoginCount'
GO

exec sp_addextendedproperty N'MS_Description', N'注册时间', N'user', N'dbo', N'table', N'Manager', N'column', N'CreateTime'
GO

exec sp_addextendedproperty N'MS_Description', N'资料最后修改日期', N'user', N'dbo', N'table', N'Manager', N'column', N'UpdateTime'
GO

exec sp_addextendedproperty N'MS_Description', N'是否允许同一帐号多人使用，0=只能单个在线，1=可以多人同时在线', N'user', N'dbo', N'table', N'Manager', N'column', N'IsMultiUser'
GO

exec sp_addextendedproperty N'MS_Description', N'所属部门ID', N'user', N'dbo', N'table', N'Manager', N'column', N'Branch_Id'
GO

exec sp_addextendedproperty N'MS_Description', N'所属部门编号，用户只能正式归属于一个部门', N'user', N'dbo', N'table', N'Manager', N'column', N'Branch_Code'
GO

exec sp_addextendedproperty N'MS_Description', N'部门名称', N'user', N'dbo', N'table', N'Manager', N'column', N'Branch_Name'
GO

exec sp_addextendedproperty N'MS_Description', N'用户职位ID', N'user', N'dbo', N'table', N'Manager', N'column', N'Position_Id'
GO

exec sp_addextendedproperty N'MS_Description', N'职位名称', N'user', N'dbo', N'table', N'Manager', N'column', N'Position_Name'
GO

exec sp_addextendedproperty N'MS_Description', N'0=离职，1=就职', N'user', N'dbo', N'table', N'Manager', N'column', N'IsWork'
GO

exec sp_addextendedproperty N'MS_Description', N'账号是否启用，1=true(启用)，0=false（禁用）', N'user', N'dbo', N'table', N'Manager', N'column', N'IsEnable'
GO

exec sp_addextendedproperty N'MS_Description', N'用户中文名称', N'user', N'dbo', N'table', N'Manager', N'column', N'CName'
GO

exec sp_addextendedproperty N'MS_Description', N'用户英文名称', N'user', N'dbo', N'table', N'Manager', N'column', N'EName'
GO

exec sp_addextendedproperty N'MS_Description', N'头像图片路径', N'user', N'dbo', N'table', N'Manager', N'column', N'PhotoImg'
GO

exec sp_addextendedproperty N'MS_Description', N'性别（0=未知，1=男，2=女）', N'user', N'dbo', N'table', N'Manager', N'column', N'Sex'
GO

exec sp_addextendedproperty N'MS_Description', N'出生日期', N'user', N'dbo', N'table', N'Manager', N'column', N'Birthday'
GO

exec sp_addextendedproperty N'MS_Description', N'籍贯', N'user', N'dbo', N'table', N'Manager', N'column', N'NativePlace'
GO

exec sp_addextendedproperty N'MS_Description', N'民族', N'user', N'dbo', N'table', N'Manager', N'column', N'NationalName'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--学历', N'user', N'dbo', N'table', N'Manager', N'column', N'Record'
GO

exec sp_addextendedproperty N'MS_Description', N'毕业学校', N'user', N'dbo', N'table', N'Manager', N'column', N'GraduateCollege'
GO

exec sp_addextendedproperty N'MS_Description', N'毕业专业', N'user', N'dbo', N'table', N'Manager', N'column', N'GraduateSpecialty'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--联系电话', N'user', N'dbo', N'table', N'Manager', N'column', N'Tel'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--移动电话', N'user', N'dbo', N'table', N'Manager', N'column', N'Mobile'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--联系邮箱', N'user', N'dbo', N'table', N'Manager', N'column', N'Email'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--QQ', N'user', N'dbo', N'table', N'Manager', N'column', N'Qq'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--Msn', N'user', N'dbo', N'table', N'Manager', N'column', N'Msn'
GO

exec sp_addextendedproperty N'MS_Description', N'个人--通讯地址', N'user', N'dbo', N'table', N'Manager', N'column', N'Address'
GO

exec sp_addextendedproperty N'MS_Description', N'备注', N'user', N'dbo', N'table', N'Manager', N'column', N'Content'
GO

exec sp_addextendedproperty N'MS_Description', N'修改人员id', N'user', N'dbo', N'table', N'Manager', N'column', N'Manager_Id'
GO

exec sp_addextendedproperty N'MS_Description', N'修改人中文名称', N'user', N'dbo', N'table', N'Manager', N'column', N'Manager_CName'
GO

/****** Object:  Table [dbo].[OnlineUsers]    Script Date: 2014/6/4 22:27:52  ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OnlineUsers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OnlineUsers]
GO

/****** Object:  Table [dbo].[OnlineUsers]    Script Date: 2014/6/4 22:27:52   ******/
CREATE TABLE [dbo].[OnlineUsers] (
  [Id] [int] IDENTITY (1, 1) NOT NULL,
  [UserHashKey] [nvarchar] (50) NOT NULL,
  [Manager_Id] [int] NOT NULL,
  [Manager_LoginName] [nvarchar] (20) NOT NULL,
  [Manager_LoginPass] [nvarchar] (32) NOT NULL,
  [Manager_CName] [nvarchar] (20) NOT NULL,
  [LoginTime] [datetime] NOT NULL,
  [LoginIp] [nvarchar] (30) NOT NULL,
  [UserKey] [nvarchar] (32) NOT NULL,
  [Md5] [nvarchar] (32) NOT NULL,
  [UpdateTime] [datetime] NOT NULL,
  [Sex] [nvarchar] (4) NOT NULL,
  [Branch_Id] [int] NOT NULL,
  [Branch_Code] [nvarchar] (20) NOT NULL,
  [Branch_Name] [nvarchar] (25) NOT NULL,
  [Position_Id] [nvarchar] (100) NOT NULL,
  [Position_Name] [nvarchar] (30) NOT NULL,
  [CurrentPage] [nvarchar] (100) NOT NULL,
  [CurrentPageTitle] [nvarchar] (250) NOT NULL,
  [SessionId] [nvarchar] (100) NOT NULL,
  [UserAgent] [nvarchar] (1000) NOT NULL,
  [OperatingSystem] [nvarchar] (50) NOT NULL,
  [TerminalType] [int] NOT NULL,
  [BrowserName] [nvarchar] (50) NOT NULL,
  [BrowserVersion] [nvarchar] (10) NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[OnlineUsers] WITH NOCHECK ADD
  CONSTRAINT [PK_OnlineUsers] PRIMARY KEY  CLUSTERED
(
 [Id]
)  ON [PRIMARY]
GO

ALTER TABLE [dbo].[OnlineUsers] ADD
  CONSTRAINT [DF_OnlineUsers_UserHashKey] DEFAULT ('') FOR [UserHashKey],
  CONSTRAINT [DF_OnlineUsers_Manager_Id] DEFAULT (0) FOR [Manager_Id],
  CONSTRAINT [DF_OnlineUsers_Manager_LoginName] DEFAULT ('') FOR [Manager_LoginName],
  CONSTRAINT [DF_OnlineUsers_Manager_LoginPass] DEFAULT ('') FOR [Manager_LoginPass],
  CONSTRAINT [DF_OnlineUsers_Manager_CName] DEFAULT ('') FOR [Manager_CName],
  CONSTRAINT [DF_OnlineUsers_LoginTime] DEFAULT (getdate()) FOR [LoginTime],
  CONSTRAINT [DF_OnlineUsers_LoginIp] DEFAULT ('') FOR [LoginIp],
  CONSTRAINT [DF_OnlineUsers_UserKey] DEFAULT ('') FOR [UserKey],
  CONSTRAINT [DF_OnlineUsers_Md5] DEFAULT ('') FOR [Md5],
  CONSTRAINT [DF_OnlineUsers_UpdateTime] DEFAULT (getdate()) FOR [UpdateTime],
  CONSTRAINT [DF_OnlineUsers_Sex] DEFAULT ('') FOR [Sex],
  CONSTRAINT [DF_OnlineUsers_Branch_Id] DEFAULT (0) FOR [Branch_Id],
  CONSTRAINT [DF_OnlineUsers_Branch_Code] DEFAULT ('') FOR [Branch_Code],
  CONSTRAINT [DF_OnlineUsers_Branch_Name] DEFAULT ('') FOR [Branch_Name],
  CONSTRAINT [DF_OnlineUsers_Position_Id] DEFAULT ('') FOR [Position_Id],
  CONSTRAINT [DF_OnlineUsers_Position_Name] DEFAULT ('') FOR [Position_Name],
  CONSTRAINT [DF_OnlineUsers_CurrentPage] DEFAULT ('') FOR [CurrentPage],
  CONSTRAINT [DF_OnlineUsers_CurrentPageTitle] DEFAULT ('') FOR [CurrentPageTitle],
  CONSTRAINT [DF_OnlineUsers_SessionId] DEFAULT ('') FOR [SessionId],
  CONSTRAINT [DF_OnlineUsers_UserAgent] DEFAULT ('') FOR [UserAgent],
  CONSTRAINT [DF_OnlineUsers_OperatingSystem] DEFAULT ('') FOR [OperatingSystem],
  CONSTRAINT [DF_OnlineUsers_TerminalType] DEFAULT (0) FOR [TerminalType],
  CONSTRAINT [DF_OnlineUsers_BrowserName] DEFAULT ('') FOR [BrowserName],
  CONSTRAINT [DF_OnlineUsers_BrowserVersion] DEFAULT ('') FOR [BrowserVersion]
GO

CREATE  INDEX [IX_OnlineUsers__Manager_Id] ON [dbo].[OnlineUsers]([Manager_Id]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__Manager_LoginName] ON [dbo].[OnlineUsers]([Manager_LoginName]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__Manager_CName] ON [dbo].[OnlineUsers]([Manager_CName]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__LoginTime] ON [dbo].[OnlineUsers]([LoginTime]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__UpdateTime] ON [dbo].[OnlineUsers]([UpdateTime]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__Branch_Id] ON [dbo].[OnlineUsers]([Branch_Id]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__Branch_Code] ON [dbo].[OnlineUsers]([Branch_Code]) ON [PRIMARY]
GO

CREATE  INDEX [IX_OnlineUsers__Position_Id] ON [dbo].[OnlineUsers]([Position_Id]) ON [PRIMARY]
GO

exec sp_addextendedproperty N'MS_Description', N'主键Id', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Id'
GO

exec sp_addextendedproperty N'MS_Description', N'在线用户列表中的HashTable Key值', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'UserHashKey'
GO

exec sp_addextendedproperty N'MS_Description', N'用户Id', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Manager_Id'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆账号', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Manager_LoginName'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆密码', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Manager_LoginPass'
GO

exec sp_addextendedproperty N'MS_Description', N'用户中文名称', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Manager_CName'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆时间', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'LoginTime'
GO

exec sp_addextendedproperty N'MS_Description', N'登陆IP', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'LoginIp'
GO

exec sp_addextendedproperty N'MS_Description', N'用户密钥', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'UserKey'
GO

exec sp_addextendedproperty N'MS_Description', N'Md5(密钥+登陆帐号+密码+IP+密钥.Substring(6,8))', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Md5'
GO

exec sp_addextendedproperty N'MS_Description', N'最后在线时间', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'UpdateTime'
GO

exec sp_addextendedproperty N'MS_Description', N'性别（0=未知，1=男，2=女）', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Sex'
GO

exec sp_addextendedproperty N'MS_Description', N'所属部门ID', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Branch_Id'
GO

exec sp_addextendedproperty N'MS_Description', N'所属部门编号，用户只能正式归属于一个部门', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Branch_Code'
GO

exec sp_addextendedproperty N'MS_Description', N'部门名称', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Branch_Name'
GO

exec sp_addextendedproperty N'MS_Description', N'用户职位ID', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Position_Id'
GO

exec sp_addextendedproperty N'MS_Description', N'职位名称', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'Position_Name'
GO

exec sp_addextendedproperty N'MS_Description', N'用户当前所在页面Url', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'CurrentPage'
GO

exec sp_addextendedproperty N'MS_Description', N'用户当前所在页面名称', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'CurrentPageTitle'
GO

exec sp_addextendedproperty N'MS_Description', N'用户SessionId', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'SessionId'
GO

exec sp_addextendedproperty N'MS_Description', N'客户端UA', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'UserAgent'
GO

exec sp_addextendedproperty N'MS_Description', N'操作系统', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'OperatingSystem'
GO

exec sp_addextendedproperty N'MS_Description', N'终端类型（0=非移动设备，1=移动设备）', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'TerminalType'
GO

exec sp_addextendedproperty N'MS_Description', N'浏览器名称', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'BrowserName'
GO

exec sp_addextendedproperty N'MS_Description', N'浏览器的版本', N'user', N'dbo', N'table', N'OnlineUsers', N'column', N'BrowserVersion'
GO


优化后的 Manager 表结构
CREATE TABLE [dbo].[Manager] ( [Id] [int] IDENTITY (1, 1) NOT NULL, [LoginName] [nvarchar](20) NOT NULL,
  [LoginPassHash] [nvarchar](256) NOT NULL,存储密码哈希值
  [LoginTime] [datetime] NOT NULL DEFAULT (GETDATE()),
  [LoginIp] [nvarchar](30) NOT NULL DEFAULT (''), -- 其他字段保持不变...
  [IsEnable] [bit] NOT NULL DEFAULT (1),使用 bit 类型代替 tinyint
  [PhotoImg] [nvarchar](250) NOT NULL DEFAULT (''),
  -- 优化性别字段，使用 CHAR(1存储 'M', 'F', 'U'
  [Sex] [char](1) NOT NULL DEFAULT ('U'), -- 使用 nvarchar(MAX替代 ntext
  [Content] [nvarchar](MAX) NOT NULL DEFAULT ('')
) ON [PRIMARY];

-- 添加外键约束示例（假设存在相应的参照表）
ALTER TABLE [dbo].[Manager] ADD CONSTRAINT FK_Manager_Branch FOREIGN KEY ([Branch_Id]) REFERENCES [dbo].[Branch]([Id]);

-- 优化后的 OnlineUsers 表结构
CREATE TABLE [dbo].[OnlineUsers] ( [Id] [int] IDENTITY (1, 1) NOT NULL,
  [UserHashKey] [nvarchar](50) NOT NULL DEFAULT (''),
  -- 其他字段保持不变...
  [BrowserVersion] [nvarchar](10) NOT NULL DEFAULT ('')
) ON [PRIMARY];

-- 添加外键约束示例（假设存在相应的参照表）
ALTER TABLE [dbo].[OnlineUsers] ADD CONSTRAINT FK_OnlineUsers_Manager FOREIGN KEY ([Manager_Id]) REFERENCES [dbo].[Manager]([Id]);